

import java.util.ArrayList;

/*
 * An entry in the symbol table.
 * 
 * Update this class with the information
 * you need to keep in the symbol table
 * for each entry.
 */

public class Entry {

	/*
	 * level is a variable used to know in switch scope level this entry was
	 * created.
	 * 
	 * This variable is used only by the Symbol Table and should remain public
	 */
	public int level;

	/*
	 * The identifier of the entry. The variable should remain public as it is
	 * used by the Symbol Table as the key for the entry in the Hash Table.
	 */
	public String id;
	public int type;
	public int category;
	public static final int VARIABLE = 0;
	public static final int METHOD = 1;
	public static final int INT = 2;
	public static final int BOOL = 3;
	public static final int STRING = 4;
	public static final int FLOAT = 5;

	// used in case that the entry is a method
	ArrayList<Integer> paramsType;

	public Entry(String id, int category, int type) {
		this(id, category);
		this.type = type;
	}

	public Entry(String id, int category) {
		super();
		this.id = id;
		this.category = category;
		if (category == Entry.METHOD)
			paramsType = new ArrayList<Integer>();
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}

	public int getCategory() {
		return category;
	}

	public void setCategory(int category) {
		this.category = category;
	}

	public String toString() {
		return id + " , " + type;
	}

}
